package com.atguigu.springcloud.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class OrderController {

    @Resource
    private RestTemplate restTemplate;

    public static final String CONSUMER_URL = "http://cloud-payment-service";

    @GetMapping("/order/consul")
    public String getConsul(){
        return restTemplate.getForObject(CONSUMER_URL+"/payment/consul",String.class);
    }
}

